/*
 * CItemQuality.java
 *
 * Copyright (c) 2009 Giles Millward (Manigra). All rights reserved.
 *
 * This file is part of JRogueDPS.
 *
 * JRogueDPS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * JRogueDPS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with JRogueDPS.  If not, see <http://www.gnu.org/licenses/>.
 */

package geardatabase;

import java.awt.Color;

/**
 *
 * @author gmillward
 */
public class CItemQuality {
    public enum ItemQuality {COMMON, UNCOMMON, RARE, EPIC, LEGENDARY, UNKNOWN};

    static Color l_backgroundCommon = new Color(255,255,255);
    static Color l_backgroundUncommon = new Color(227,255,227);
    static Color l_backgroundRare = new Color(227,227,255);
    static Color l_backgroundEpic = new Color(255,227,255);
    static Color l_backgroundLegendary = new Color(255,255,190);
    static Color l_backgroundUnknown = new Color(255,255,255);
    
    static public Color getBackColor(ItemQuality p_itemQuality)
    {
        if (p_itemQuality == ItemQuality.EPIC)
        {
            return l_backgroundEpic;
        } else if (p_itemQuality == ItemQuality.RARE)
        {
            return l_backgroundRare;
        } else if (p_itemQuality == ItemQuality.UNCOMMON)
        {
            return l_backgroundUncommon;
        } else if (p_itemQuality == ItemQuality.COMMON)
        {
            return l_backgroundCommon;
        } else if (p_itemQuality == ItemQuality.LEGENDARY)
        {
            return l_backgroundLegendary;
        }

        return l_backgroundUnknown;
    }

    static public int getSortOrder(ItemQuality p_itemQuality)
    {
        if (p_itemQuality == ItemQuality.LEGENDARY)
        {
            return 1;
        } else if (p_itemQuality == ItemQuality.EPIC)
        {
            return 2;
        } else if (p_itemQuality == ItemQuality.RARE)
        {
            return 3;
        } else if (p_itemQuality == ItemQuality.UNCOMMON)
        {
            return 4;
        } else if (p_itemQuality == ItemQuality.COMMON)
        {
            return 5;
        }

        return 6;
    }
}
